﻿using System;

namespace UpperComputer.WPF.Entry.Common.Extensions
{
    public static class ObjectToOtherExtensions
    {
        public static bool ToBoolean(this object obj)
        {
            return Convert.ToBoolean(obj);
        }

        public static short ToShort(this object obj)
        {
            return Convert.ToInt16(obj);
        }

        public static double ToDouble(this object obj, int digits = 1)
        {
            return Math.Round(Convert.ToDouble(obj), digits);
        }
    }
}
